-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create FlagCommentPage #19412
Create FlagCommentPage #19412
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice - looks solid! Just a NAB
@eVoloshchak @youssef-lr One of you needs to copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosWebScreen.Recording.2023-05-31.at.18.13.17.movMobile Web - ChromeMobile Web - SafariScreen.Recording.2023-05-31.at.18.14.42.movDesktopScreen.Recording.2023-05-31.at.18.16.31.moviOSScreen.Recording.2023-05-31.at.18.15.45.movAndroid |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found a couple of issues:
- Navigate to a conversation
- Right-click on someone elses message
- Select "Reply in thread"
- Right click on the message in thread
- Select "Flag as offensive"
- Press on any severity option
- Notice nothing is happening and there's error in console
Screen.Recording.2023-05-30.at.14.36.19.mov
On mWeb/iOS/Android or web with isSmallScreenWidth = true
- Select "Flag as offensive" on any message
- Press on any severity option
- Notice that you're navigated back twice (to the list with chats) instead of to the current chat
screen-20230530-143910.mp4
Figured out the double navigation thing; the threads bit is becoming a little trickier. Have asked in Slack here - it's because the route is giving us the new, thread reportID, not the original - so the reportAction isn't found on the new report. |
okay i think i fixed the bugs you found @eVoloshchak. @youssef-lr I am also sometimes getting that issue; doesn't seem like it's related to this, but we can look into it in PHP |
@dangrous it's weird though that it's only happening with whispers? as regular messages updates work properly. |
annnnnd it does look like attachments will work! I've updated to allow them to be flagged. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! The bug I found should be fixed in the backend I think.
sorry @youssef-lr I needed to add prettier, can you approve again (i'll still wait for confirmation from @eVoloshchak before merging tho) |
Found one more edge case where the reveal button is hidden for a second
Screen.Recording.2023-05-31.at.18.08.25.mov |
ooh I think I know why that's happening, it's because onyx.merge goes much deeper than I thought. I thought that this part of the flagComment method was replacing the existing moderationDecisions but it's actually merging them, i.e. adding them. I can get around it in the meantime by just always looking at the latestdecision but not sure if there's a cleaner way. |
should be fixed now |
whatttt i fixed that. |
fixed. Thanks for being so thorough @eVoloshchak ! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
🚀 Deployed to staging by https://github.com/youssef-lr in version: 1.3.21-1 🚀
|
🚀 Deployed to production by https://github.com/AndrewGable in version: 1.3.21-2 🚀
|
ReportUtils.canFlagReportAction(reportAction, reportID) && | ||
!isArchivedRoom && | ||
!isChronosReport && | ||
!ReportUtils.isConciergeChatReport(reportID) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @dangrous Coming from #20197 In this issue, we come up with that ReportUtils.isConciergeChatReport will return true if it is main chat with Concierge (not include thread with Concierge). But the thread chat with Concierge also should not show flag option. Fortuantley, the below condition reportAction.actorEmail !== CONST.EMAIL.CONCIERGE,
just handled this case so this condition !ReportUtils.isConciergeChatReport(reportID) is redundant. Should we remove it?
cc @eVoloshchak
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's right! Shouldn't be a need for that. cc @thienlnam in case you see anything wrong with that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah sounds good to me, as long as you don't see flag messages in a Concierge chat the problem is solved
)); | ||
|
||
return ( | ||
<ScreenWrapper includeSafeAreaPaddingBottom={false}> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think when we created this component, we didn't add any access controls. Hence this caused a regression.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahhhh nice catch, thank you for calling it out!
cc @thienlnam
Details
This is prepping for moderation! You will not see any visual changes to the content right now - not until #19476 is complete - but you can check the props in your console/inspector to make sure that the moderationDecisions property for flagged messages is updated appropriately. You should also get a whisper back, both as the reporter and as the author of the flagged content.
You will also get the 1:1:1 too many commands alert for this on dev - that's because it's flagging the comment and sending two whispers (3x commands total). No way around this at the moment, we'll update the listing on PHP shortly.
Fixed Issues
$ #18508
$ #18503
Tests
Offline tests
QA Steps
Same as tests
PR Author Checklist
### Fixed Issues
section aboveTests
sectionOffline steps
sectionQA steps
sectiontoggleReport
and notonIconClick
)myBool && <MyComponent />
.src/languages/*
files and using the translation methodWaiting for Copy
label for a copy review on the original GH to get the correct copy.STYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
this
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG)
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)ScrollView
component to make it scrollable when more elements are added to the page.main
branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTest
steps.Screenshots/Videos
Web
Mobile Web - Chrome
Mobile Web - Safari
Desktop
iOS
I cannot run the iOS app currently due to XCode 14.3
Android